/**
 * @Author: 李文浩
 * @Date: 2019/8/15
 * @Last Modified by: 杨光宇
 * @Last Modified time: 2021-02-08 11:20:20
 */
import axios from '@/api/fetch';
import SERVER from '@/api/server';

// 店端查询
export const selectWarrantyDateChange = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}/changeWarrantyDate/selectWarrantyDateChange`, { params });

// 保存，编辑，新增里程修改 - 共用接口
export const applyWarrantyDateChange = params => axios.post(`${SERVER.DMSCLOUD_REPAIR}/changeWarrantyDate/applyWarrantyDateChange`, params);

// 查询所有工单
export const searchRepairOrder = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}/changeWarrantyDate/searchRepairOrder`, { params });

// 厂端查询
export const selectWarrantyDateChangeFactory = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}/changeWarrantyDate/selectWarrantyDateChangeFactory`, { params });

// 申请记录log
export const selectWarrantyDateChangeLog = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}/changeWarrantyDate/selectWarrantyDateChangeLog`, { params });

// 审批 - 厂端 99931004通过 999310003驳回 99931005拒绝
export const warrantyDateChangeAssessor = params => axios.post(`${SERVER.DMSCLOUD_REPAIR}/changeWarrantyDate/warrantyDateChangeAssessor`, params);
// 查询所有人
export const getAllUser = params => axios.get(`${SERVER.DMSCLOUD_BASEDATA}/basedata/users/getDealerUser`);
// 店端导出
export const dealerExportWarranty = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}/changeWarrantyDate/dealerExportWarranty`, { params, responseType: 'arraybuffer' });
// 厂端导出
export const factoryExportWarranty = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}/changeWarrantyDate/factoryExportWarranty`, { params, responseType: 'arraybuffer' });
//获取所有经销商
export const getAllDealer = params => axios.get(`${SERVER.CMSCLOUD_CHANNEL}/message/dealerAttach/dealerInfo/byAllTranslate`, { params });
